home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Essentials / Developer Essentials Nov 90 / Apple II / Apple.II.partition / Tools / DTS.Samples / SC17Darts / Darts.p / UUtils.inc.p < prev    next >
Encoding:
Text File  |  1990-06-25  |  881 b   |  36 lines  |  [TEXT/pdos]

  1. {**********************************************************************
  2. {*
  3. {* Darts uUtils -- Version 3.0  (interface)
  4. {*
  5. {* Copyright (c)
  6. {* Apple Computer, Inc.  1986-1989
  7. {* All Rights Reserved.
  8. {*
  9. {* Developer Technical Support Apple II Sample Code
  10. {*
  11. {* This file contains the code which implements  
  12. {* any utility routines used by the program.
  13. {*
  14. {**********************************************************************}
  15. {$R-}
  16.  
  17.  
  18. FUNCTION IntToString (i : Integer): STR255;
  19. var
  20.   size : integer;
  21.   Negative : boolean;
  22.   str : string[20];
  23. BEGIN
  24.     Negative := i < 0;
  25.     if Negative then i := -i;
  26.     if i < 10 then size := 1
  27.     else if i < 100 then size := 2
  28.     else if i < 1000 then size := 3
  29.     else if i < 10000 then size := 4;
  30.     
  31.     Long2Dec(i,@Str[1],size,false);
  32.     Str[0] := char(size);
  33.     if Negative then Str := concat('-',Str);
  34.     IntToString := Str;
  35. END;
  36.